package org.zero.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.zero.consumer.client.LocalClient;

/**
 * @author yezhaoxing
 * @date 2020/3/16
 */
@RestController
public class ConsumerController {

    @Autowired
    private LocalClient localClient;

    @GetMapping(value = "/hi")
    public String sayHi(@RequestParam String name) {
        System.out.println("发起请求:" + name);
        String consumer = localClient.consumer(name);
        System.out.println("返回结果:" + name
        );
        return consumer;
    }
}
